#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
/*
for a graph with n vertice has n * (n - 1) / 2 edges at most

and we can use (m + 1) / 2 edges to make the graph don't have isolated vertices
*/

LL n, m;

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n >> m;

    if(m * 2 >= n){
        cout << 0 << " ";
    }else{
        cout << n - m * 2 << " ";
    }

    int k = 1;
    while(((LL)k - 1) * k / 2 < m) k ++;

    if(k == 1){  k = 0;}

    cout << n - k << '\n';


    return 0;
}